const pageProps = require('../tw-lib-base/page/props')

module.exports = {
  eventEnabel: {
    type: Boolean,
    default: false,
    name: '启用点击事件',
    nameTip: '启用点击事件后，点击导航不再跳转页面，而是会触发change事件',
    filedType: 'switch'
  },

  value: {
    type: String,
    default: '',
    name: '选中的导航Id',
    filedType: 'value',
    vif: {
      key: 'eventEnabel',
      value: true
    }
  },

  activeNav: {
    type: String,
    default: '',
    name: '选中的导航',
    filedType: 'sync',
    vif: {
      key: 'eventEnabel',
      value: true
    }
  },

  navs: {
    type: Array,
    default () {
      return [
        {
          name: '导航1',
          href: '/nav1.html',
          activeText: ''
        },
        {
          id: 'role',
          name: '权限导航',
          href: '/role.html',
          roles: ['1000000002']
        },
        {
          name: '导航2',
          children: [
            {
              name: '子导航1',
              href: '/nav2-1.html'
            },
            {
              name: '子导航2',
              children: [
                {
                  name: '三级导航1',
                  href: '/nav2-2-1.html'
                },
                {
                  name: '三级导航2',
                  href: '/nav2-2-2.html'
                },
                {
                  name: '三级导航2',
                  href: '/nav2-2-2.html'
                },
                {
                  name: '三级导航2',
                  href: '/nav2-2-2.html'
                },
                {
                  name: '三级导航2',
                  href: '/nav2-2-2.html'
                },
                {
                  name: '三级导航2',
                  href: '/nav2-2-2.html'
                },
                {
                  name: '三级导航2',
                  href: '/nav2-2-2.html'
                },
                {
                  name: '三级导航2',
                  href: '/nav2-2-2.html'
                },
                {
                  name: '三级导航2',
                  href: '/nav2-2-2.html'
                },
                {
                  name: '三级导航2',
                  href: '/nav2-2-2.html'
                },
                {
                  name: '三级导航2',
                  href: '/nav2-2-2.html'
                },
                {
                  name: '三级导航2',
                  href: '/nav2-2-2.html'
                },
                {
                  name: '三级导航2',
                  href: '/nav2-2-2.html'
                }
              ]
            }
          ]
        }
      ]
    },
    name: '导航列表',
    nameTip: '数组，最多支持三级导航，每一项属性的含义为：\nname:导航名称, 必需\nhref:导航跳转地址, 当为父级导航时无需指定\nname:roles, 显示改导航的角色id列表，请参照eco角色\nid:当启用点击事件, 且指定了id值时，选中的导航id为该id值，未指定则为name值',
    filedType: 'api'
  },

  navVifFunction: {
    type: Function,
    default: '',
    name: '菜单是否显示的回调函数',
    nameTip: '接受的第一个参数为菜单本身，第二个参数导航菜单列表，返回true显示，返回false不显示',
    placeholder: 'function handler(nav, navList) {\n  \n}',
    filedType: 'function'
  },

  openedOnlyOne: {
    type: Boolean,
    default: false,
    name: '仅可同时打开一个同级菜单',
    filedType: 'switch'
  },

  ...pageProps,

  navTitleEnable: {
    type: Boolean,
    default: true,
    name: '开启侧导航标题',
    filedType: 'switch'
  },

  navTitle: {
    type: String,
    default: '侧导航标题',
    name: '侧导航标题',
    filedType: 'string',
    vif: {
      key: 'navTitleEnable',
      value: true
    }
  },

  navTitlePaddingX: {
    type: String,
    default: '10px',
    name: '导航标题左右内边距',
    filedType: 'string'
  },

  navTitleAlign: {
    type: String,
    default: 'center',
    name: '侧导航标题对齐方式',
    filedType: 'select',
    options: [
      {
        name: '左对齐',
        value: 'left'
      },
      {
        name: '居中',
        value: 'center'
      },
      {
        name: '右对齐',
        value: 'right'
      }
    ]
  },

  hasNavTitltShadow: {
    type: Boolean,
    default: true,
    name: '标题边框外阴影',
    filedType: 'switch'
  },

  hasNavShadow: {
    type: Boolean,
    default: true,
    name: '侧边导航边框外阴影',
    filedType: 'switch'
  },

  navBoxBg: {
    type: String,
    default: '#ffffff',
    name: '导航容器背景',
    filedType: 'color'
  },

  navBoxRadius: {
    type: String,
    default: '0px',
    name: '导航容器圆角',
    filedType: 'string'
  },

  navTitleHeight: {
    type: String,
    default: '50px',
    name: '标题高度',
    filedType: 'string'
  },

  navTitleBg: {
    type: String,
    default: '#f12e22',
    name: '标题背景',
    filedType: 'color'
  },

  navTitleImg: {
    type: Array,
    default () {
      return [
      ]
    },
    name: '标题背景图片',
    filedType: 'file',
    limit: 1,
    maxSize: 1024
  },

  navTitleBgColor1: {
    type: String,
    default: '',
    name: '标题背景渐变色1',
    filedType: 'color'
  },

  navTitleBgColor2: {
    type: String,
    default: '',
    name: '标题背景渐变色2',
    filedType: 'color'
  },

  navTitleGradientDeg: {
    type: String,
    default: '90',
    name: '标题背景渐变色角度',
    filedType: 'string'
  },

  navTitleSize: {
    type: String,
    default: '18px',
    name: '标题文本大小',
    filedType: 'string'
  },

  navTitleColor: {
    type: String,
    default: '#ffffff',
    name: '标题文本颜色',
    filedType: 'color'
  },

  navTitleIsBlod: {
    type: Boolean,
    default: true,
    name: '标题文本显示为粗体',
    filedType: 'switch'
  },

  navTitleHasBorder: {
    type: Boolean,
    default: false,
    name: '标题边框线显示',
    filedType: 'switch'
  },

  navTitleBorderPosition: {
    type: Array,
    default () {
      return [0, 1, 2, 3]
    },
    name: '标题边框位置',
    filedType: 'select',
    options: [
      {
        name: '上边框',
        value: 0
      },
      {
        name: '下边框',
        value: 1
      },
      {
        name: '左边框',
        value: 2
      },
      {
        name: '右边框',
        value: 3
      }
    ],
    multiple: true,
    vif: {
      key: 'navTitleHasBorder',
      value: true
    }
  },

  navTitleBorderColor: {
    type: String,
    default: '#cccccc',
    name: '标题边框线颜色',
    filedType: 'color',
    vif: {
      key: 'navTitleHasBorder',
      value: true
    }
  },

  navTitleBorderSize: {
    type: String,
    default: '1px',
    name: '标题边框线宽度',
    filedType: 'string',
    vif: {
      key: 'navTitleHasBorder',
      value: true
    }
  },

  navTitleBorderType: {
    type: Array,
    default: 'solid',
    name: '标题边框线样式',
    filedType: 'select',
    options: [
      {
        name: '实线',
        value: 'solid'
      },
      {
        name: '虚线',
        value: 'dashed'
      },
      {
        name: '点划线',
        value: 'dotted'
      }
    ],
    vif: {
      key: 'navTitleHasBorder',
      value: true
    }
  },

  navBgColor: {
    type: String,
    default: 'transparent',
    name: '导航背景颜色设置',
    filedType: 'color'
  },

  navDistance: {
    type: String,
    default: '10px',
    name: '导航距离下列的间距',
    filedType: 'string'
  },

  navItemHeight: {
    type: String,
    default: '34px',
    name: '导航项高度',
    filedType: 'string'
  },

  navItemFontSize: {
    type: String,
    default: '16px',
    name: '导航项字体大小',
    filedType: 'string'
  },

  navItemColor: {
    type: String,
    default: '#333333',
    name: '导航项字体颜色',
    filedType: 'color'
  },

  navItemActiveBg: {
    type: String,
    default: '#fce9e7',
    name: '导航项选中背景',
    filedType: 'color'
  },

  navItemActiveColor: {
    type: String,
    default: '#e62517',
    name: '导航项选中文本颜色',
    filedType: 'color'
  },
  navItemActiveIsBlod: {
    type: Boolean,
    default: true,
    name: '导航项选中文本显示为粗体',
    filedType: 'switch'
  },

  navPaddingX: {
    type: String,
    default: '10px',
    name: '导航左右内边距',
    filedType: 'string'
  },

  navBodyPaddingY: {
    type: String,
    default: '10px',
    name: '内边距设置',
    filedType: 'string'
  },

  indentation: {
    type: String,
    default: '15px',
    name: '子导航缩进',
    filedType: 'string'
  },

  subNavLineHeight: {
    type: String,
    default: '',
    name: '子导航行高',
    filedType: 'string'
  },

  subNavMaxHeight: {
    type: String,
    default: '',
    name: '子导航容器最大高度',
    filedType: 'string'
  },

  subNavFontSize: {
    type: String,
    default: '12px',
    name: '子导航文本大小',
    filedType: 'string'
  },

  subNavColor: {
    type: String,
    default: '#666666',
    name: '子导航文本颜色',
    filedType: 'string'
  },

  navItemHasBorder: {
    type: Boolean,
    default: false,
    name: '导航项边框显示',
    filedType: 'switch'
  },

  navItemBorderPosition: {
    type: Array,
    default () {
      return [0, 1, 2, 3]
    },
    name: '导航项边框位置',
    filedType: 'select',
    options: [
      {
        name: '上边框',
        value: 0
      },
      {
        name: '下边框',
        value: 1
      },
      {
        name: '左边框',
        value: 2
      },
      {
        name: '右边框',
        value: 3
      }
    ],
    multiple: true,
    vif: {
      key: 'navItemHasBorder',
      value: true
    }
  },

  navItemBorderColor: {
    type: String,
    default: '#cccccc',
    name: '导航项边框颜色',
    filedType: 'color',
    vif: {
      key: 'navItemHasBorder',
      value: true
    }
  },

  navItemBorderSize: {
    type: String,
    default: '1px',
    name: '导航项边框宽度',
    filedType: 'string',
    vif: {
      key: 'navItemHasBorder',
      value: true
    }
  },

  navItemBorderType: {
    type: Array,
    default: 'solid',
    name: '导航项边框样式',
    filedType: 'select',
    options: [
      {
        name: '实线',
        value: 'solid'
      },
      {
        name: '虚线',
        value: 'dashed'
      },
      {
        name: '点划线',
        value: 'dotted'
      }
    ],
    vif: {
      key: 'navItemHasBorder',
      value: true
    }
  },

  icons: {
    type: Array,
    default () {
      return [
      ]
    },
    name: '一级导航图标列表',
    filedType: 'file',
    limit: 100,
    maxSize: 1024
  },

  hoverIcons: {
    type: Array,
    default () {
      return [
      ]
    },
    name: '一级导航滑过图标列表',
    filedType: 'file',
    limit: 100,
    maxSize: 1024
  },

  iconMarginRight: {
    type: String,
    default: '10px',
    name: '图标右侧间距',
    filedType: 'string'
  },

  itemWrap: {
    type: Boolean,
    default: true,
    name: '文本可换行',
    filedType: 'switch'
  },

  ifShowSubNavIco: {
    type: Boolean,
    default: false,
    name: '无子菜单时也显示右侧图标',
    filedType: 'switch'
  },

  selfNavMore: {
    type: Boolean,
    default: false,
    name: '导航项展开收起图标',
    filedType: 'switch'
  },

  selfNavFold: {
    type: Array,
    default () {
      return [
      ]
    },
    name: '导航项收起图标',
    filedType: 'file',
    limit: 1,
    maxSize: 1024,
    vif: {
      key: 'selfNavMore',
      value: true
    }
  },

  selfNavUnFold: {
    type: Array,
    default () {
      return [
      ]
    },
    name: '导航项展开图标',
    filedType: 'file',
    limit: 1,
    maxSize: 1024,
    vif: {
      key: 'selfNavMore',
      value: true
    }
  },

  clickNavFn: {
    type: Function,
    default: '',
    name: '单击导航回调函数',
    nameTip: '第一个参数即为当前的选中导航',
    placeholder: 'function handler(nav) {\n  \n}',
    filedType: 'function'
  }
}
